package com.huadi.ssm.Service;

import com.huadi.ssm.dao.UserMapper;
import com.huadi.ssm.po.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public class UserServiceImpl implements UserService{
    private int userType;
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUserByUserId(String userId) {
        return userMapper.deleteUserByUserId(userId);

    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public User findUserByUserId(String userId) {
        return userMapper.findUserByUserId(userId);
    }

    @Override
    public List<User> findAllUser() {
        return userMapper.findAllUser();
    }

    @Override
    public int changePassword( String userId,  String userPassword){
        return userMapper.changePassword(userId,userPassword);
    }

    @Override
    public User login(String userId, String userPassword) {
        return userMapper.login(userId,userPassword);
    }
}
